#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;

class Complex {
	double r, i;
public:
	Complex(double r = 0, double i = 0) :r(r), i(i) {}
	friend ostream& operator<<(ostream& out, const Complex& c);
	friend istream& operator>>(istream& in, Complex& c);
};

ostream& operator<<(ostream& out, const Complex& c)
{
	out << c.r << "+" << c.i << "i";
	return out;
}
istream& operator>>(istream& in, Complex& c)
{
	string s;
	in >> s;
	int pos = s.find("+", 0);
	string sTmp = s.substr(0, pos);
	c.r = atof(sTmp.c_str());
	sTmp = s.substr(pos + 1, s.length() - pos - 2);
	c.i = atof(sTmp.c_str());
	return in;
}

int main()
{
	Complex c;
	int n;
	cin >> c >> n;
	cout << c << "," << n;
	return 0;
}